//
//  Constant.h
//  封装
//
//  Created by boleguigu_dev1 on 16/4/27.
//  Copyright © 2016年 boleguigu_dev1. All rights reserved.
//

#ifndef Constant_h
#define Constant_h
//屏幕款高
#define UI_WIDTH [UIScreen mainScreen].bounds.size.width
#define UI_HEIGHT [UIScreen mainScreen].bounds.size.height

//根据屏幕宽度按比例缩放
#define WidthScale  ( [[UIScreen mainScreen] bounds].size.width/320)
//设置颜色 传入0xFFFFFF类型
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

//时间戳
#define TimeStamp [NSString stringWithFormat:@"%f",[[NSDate date] timeIntervalSince1970] * 1000]

//GUID String
#define GUID [[NSUUID UUID] UUIDString]

//设置颜色
#define UIColorFromrgb(r,g,b,a) [UIColor colorWithRed:((r)/255.0) green:((g)/255.0) blue:((b)/255.0) alpha:(a)]

//获取UserDefaults
#define DEFAULTS [NSUserDefaults standardUserDefaults]

//获取appdelegate
#define ShareAppDelegate [[UIApplication sharedApplication] delegate]

//设置toast图片的类型
typedef enum {
    ToastNone=0,
    ToastSuccess,
    ToastWarning,
    ToastFailed
}ToastState;

//设置传入的token类型
typedef enum {
    Token=0,//正常登陆后的token
    loginToken,//未登陆时需要用到token时传的token
    fileToken,//传送文件时需要用的token
}TokenState;

//通知名
#define kDidReceiveMessage @"kDidReceiveMessage" //收到消息通知
#define kDidSendMessageList @"kDidSendMessageList" //发送消息通知
#define kDidReceiveMessageList @"kDidReceiveMessageList"
#define kDidBadgeChange @"kDidBadgeChange" //未读数量发生变化
#define kDidUnauthorized @"kDidUnauthorized" //未授权，需要登录

#endif /* Constant_h */
